package com.collins.thread.practices.restaurantQueue;

import java.util.Random;
import java.util.concurrent.ArrayBlockingQueue;

public class Desk {

    public ArrayBlockingQueue<String> queue;
    // rng
    public static Random random = new Random();

    public static void main(String[] args) {
        ArrayBlockingQueue<String> queue = new ArrayBlockingQueue<>(10);
        Consumer consumerRunnable = new Consumer(queue);
        Producer producerRunnable = new Producer(queue);

        Thread producer1 = new Thread(producerRunnable);
        Thread producer2 = new Thread(producerRunnable);
        Thread consumer1 = new Thread(consumerRunnable);
        Thread consumer2 = new Thread(consumerRunnable);

        producer1.setName("producer1");
        producer2.setName("producer2");
        consumer1.setName("consumer1");
        consumer2.setName("consumer2");

        producer1.start();
        producer2.start();
        consumer1.start();
        consumer2.start();
    }
}
